<?xml version="1.0" encoding="UTF-8"?>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">

<h:panelGroup id="dvGoodwillGood">
    <h:form>
        <h:outputText value="#{crossReferenceMsg.min3}" style="font-size: 11px; color:red; font-weight: bold"/><br/>
        <h:outputLabel value="#{goodwillGoodMsg.searchName}" for="tbSearchFilter"
                       style="font-size: 14px;font-weight: bold;"/>
        <h:inputText id="tbSearchFilter" value="#{GoodwillGoodBean.searchText}"/>
        <a4j:commandButton id="btnSearchFilter"
                           action="#{GoodwillGoodBean.search}"
                           value="#{goodwillGoodMsg.search}"
                           reRender="dvFilters"/>

        <rich:hotKey key="return"
                     handler="#{rich:element('btnSearchFilter')}.click()"
                     selector="#dvGoodwillGood"/>
    </h:form>
</h:panelGroup>
<h:panelGroup id="dvFilters">
    <h:panelGroup id="dvFiltersEmpty" rendered="#{empty GoodwillGoodBean.filters}">
        <h:outputText value="#{goodwillGoodMsg.filtersSearchHint}" rendered="#{empty GoodwillGoodBean.searchText}"/>
        <h:outputText value="#{goodwillGoodMsg.doDataFound}" rendered="#{not empty GoodwillGoodBean.searchText}"/>
    </h:panelGroup>
    <h:panelGroup id="dvFiltersNotEmpty" rendered="#{not empty GoodwillGoodBean.filters}">
        <h:form>
            <rich:dataTable id="tblFilters"
                            value="#{GoodwillGoodBean.filters}"
                            var="filter"
                            columnClasses="grey bold, grey, white"
                            sortMode="single"
                            title="#{searchAutoMsg.filters}"
                            width="100%"
                            rows="25"
                            reRender="dsFiltersTable">
                <f:facet name="header">
                    <rich:columnGroup>
                        <rich:column colspan="3">
                            <h:outputLabel value="#{searchAutoMsg.filters}"/>
                        </rich:column>
                    </rich:columnGroup>
                </f:facet>
                <rich:column sortBy="#{filter.name}">
                    <f:facet name="header">
                        <h:outputLabel value="#{searchAutoMsg.name}" title="#{searchAutoMsg.name}"/>
                    </f:facet>
                    <h:outputText value="#{filter.name}"/>
                </rich:column>
                <rich:column sortBy="#{filter.filterTypeCode}">
                    <f:facet name="header">
                        <h:outputLabel value="#{searchAutoMsg.filterType}" title="#{searchAutoMsg.filterType}"/>
                    </f:facet>
                    <h:outputText value="#{filter.filterTypeCode}" converter="#{FilterTypeCodeConverter}"/>
                </rich:column>
                <rich:column>
                    <h:panelGrid columns="3" cellpadding="2" cellspacing="2">
                        <h:outputLink onclick="showFoto(#{filter.id});return false;">
                            <h:outputText value="#{searchAutoMsg.showFoto}"/>
                        </h:outputLink>
                        <h:outputLink onclick="showApplication(#{filter.id});return false;">
                            <h:outputText value="#{searchAutoMsg.showApplication}"/>
                        </h:outputLink>
                        <h:outputLink onclick="showAnalogs(#{filter.id});return false;">
                            <h:outputText value="#{searchAutoMsg.showAnalogs}"/>
                        </h:outputLink>
                    </h:panelGrid>
                </rich:column>
                <f:facet name="footer">
                    <rich:datascroller id="dsFiltersTable"/>
                </f:facet>
            </rich:dataTable>

            <rich:jQuery selector="#tblFilters .rich-table-cell"
                         query="mouseover(function(){jQuery(this).parent().children().addClass('hoovered_row')})"/>
            <rich:jQuery selector="#tblFilters .rich-table-cell"
                         query="mouseout(function(){jQuery(this).parent().children().removeClass('hoovered_row')})"/>
        </h:form>
    </h:panelGroup>
</h:panelGroup>
</html>
